package exception;

/**
 * 自定义异常
 *
 *
 * illegal  非法的
 */
public class IllegalAgeException extends Exception{
    private int age;

    public int getAge() {
        return age;
    }

    public IllegalAgeException(int age) {
        this.age = age;
    }

    public IllegalAgeException(String message, int age) {
        super(message);
        this.age = age;
    }

    public IllegalAgeException(String message, Throwable cause, int age) {
        super(message, cause);
        this.age = age;
    }

    public IllegalAgeException(Throwable cause, int age) {
        super(cause);
        this.age = age;
    }

    public IllegalAgeException(String message, Throwable cause, boolean enableSuppression, boolean writableStackTrace, int age) {
        super(message, cause, enableSuppression, writableStackTrace);
        this.age = age;
    }

    public void setAge(int age) {
        this.age = age;
    }
}
